﻿#pragma once

#include "Containers/ThreadSafePtr.h"
#include "Containers/Map.h"
#include "Containers/Vector.h"
#include "Render/PreRender/PreRenderMaterial.h"

class CVulkanPipeline;
class CVulkanMaterialParameter;
class CVulkanMaterial;
class CVulkanShaders;
class CVulkanTexture2Ds;
class CVulkanTextureCubes;

class CVulkanMaterials
{
public:
    void UpdateMaterials(
        const TVector<std::shared_ptr<CPreRenderMaterial>>& InMaterials,
        CVulkanShaders* Shaders,
        CVulkanTexture2Ds* Texture2Ds,
        CVulkanTextureCubes* TextureCubes
        );

    std::shared_ptr<CVulkanMaterial> FindVulkanObj(
        std::shared_ptr<CPreRenderMaterial> InMaterial 
        );
protected:
    TMap< SPreRenderPipeline
        ,std::shared_ptr<CVulkanPipeline> > MaterialPipelines;

    TMap<SPreRenderMaterialParameters
        ,std::shared_ptr<CVulkanMaterialParameter> > MaterialParameters;
    
    TMap< std::shared_ptr<CPreRenderMaterial>
        ,std::shared_ptr<CVulkanMaterial> > Materials;

};